﻿namespace Preactor.ObjectModel.BaseTypes.MaterialControl
{
    using System;

    using Preactor.ObjectModel.Attributes;
    using Preactor.ObjectModel.Entities;
    using Preactor.ObjectModel.Interfaces.MaterialControl;

    public class CoProduct : PreactorRecord, ICoProduct
    {
        public CoProduct(PrimaryKey id, PreactorObjectModel preactorObjectModel)
            : base(id, preactorObjectModel)
        {
        }

        [PreactorField("COPRODUCT TABLE", FieldDeclarationType.FieldClassification)]
        public int Number { get { return (int)GetValue("Number"); } set { SetValue("Number", value); } }

        [PreactorField("Order No.", FieldDeclarationType.FieldClassification)]
        public string OrderNumber { get { return (string)GetValue("OrderNumber"); } set { SetValue("OrderNumber", value); } }

        [PreactorField("Op. No.", FieldDeclarationType.FieldClassification)]
        public int OperationNumber { get { return (int)GetValue("OperationNumber"); } set { SetValue("OperationNumber", value); } }

        [PreactorField("COPRODUCT PART NO", FieldDeclarationType.FieldClassification)]
        public string PartNumber { get { return (string)GetValue("PartNumber"); } set { SetValue("PartNumber", value); } }

        [PreactorField("COPRODUCT QUANTITY", FieldDeclarationType.FieldClassification)]
        public double Quantity { get { return (double)GetValue("Quantity"); } set { SetValue("Quantity", value); } }

        [PreactorField("QUANTITY PER UNIT", FieldDeclarationType.FieldClassification)]
        public bool MultiplyByOrderQuantity { get { return (bool)GetValue("MultiplyByOrderQuantity"); } set { SetValue("MultiplyByOrderQuantity", value); } }

        [PreactorField("Import Marker", FieldDeclarationType.FieldClassification)]
        public int ImportMarker { get { return (int)GetValue("ImportMarker"); } set { SetValue("ImportMarker", value); } }
    }
}